package dq.studty.rmi;

import dq.study.rmi.IServer;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 * @author dongqun
 * @version 1.0
 * @description 类的功能描述
 * @date 2019/9/26 10:25
 */
public class Client {
    public static void main(String[] args) throws RemoteException, NotBoundException, MalformedURLException {
        Registry registry = LocateRegistry.getRegistry(
                "localhost",
                1099);
        IServer server = (IServer) registry.lookup("rmi://localhost:1099/myrmi");
        System.out.println(server.hello("你好啊啊啊啊啊"));
        System.out.println(server.getPerson("王莎莎","女"));
    }
}
